package net.maku.utils;

//https://blog.csdn.net/qq_40905804/article/details/126000797

import java.util.Collections;
import java.util.List;

//import com.baomidou.mybatisplus.generator.FastAutoGenerator;
//import com.baomidou.mybatisplus.generator.config.OutputFile;
//import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

/*
public class MysqlGenerator {
	
	
	public static void tmain( String tbl) {
		//String url = "jdbc:mysql://192.168.10.100:3306/sundsoft_zzgl?characterEncoding=utf-8&useUnicode=true&serverTimezone=UTC";
		String url = "jdbc:mysql://192.168.10.100:3306/db_admin?characterEncoding=utf-8&useUnicode=true&serverTimezone=UTC";
		String username = "jishu";
		String password = "jishu";
		
		String gndir = "D:/home/mysql";
		String pkg = "com.cpt.wtc";
		FastAutoGenerator.create(url, username, password)
	    .globalConfig(builder -> {
	        builder.author("yanyh") // 设置作者
	            .enableSwagger() // 开启 swagger 模式
	            .fileOverride() // 覆盖已生成文件
	            .outputDir(gndir); // 指定输出目录
	    })
	    .packageConfig(builder -> {
	        builder.parent(pkg) // 设置父包名
	            //.moduleName("cpt") // 设置父包模块名
	            .pathInfo(Collections.singletonMap(OutputFile.mapperXml, gndir)); // 设置mapperXml生成路径
	    })
	    .strategyConfig(builder -> {
	        //builder.addInclude(tbl); // 设置需要生成的表名
	    	builder.addInclude(tbl).addTablePrefix("t_", "c_"); // 设置过滤表前缀
	    })
	    .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板，默认的是Velocity引擎模板
	    .execute();
	}
	
	
	public static void tmain(  List<String> list ) {
		//String url = "jdbc:mysql://192.168.10.100:3306/ry-vue?characterEncoding=utf-8&useUnicode=true&serverTimezone=UTC";
		//String url = "jdbc:mysql://192.168.10.100:3306/db_admin?characterEncoding=utf-8&useUnicode=true&serverTimezone=UTC";
		String url = "jdbc:mysql://8.140.171.243:3306/webpr?characterEncoding=utf-8&useUnicode=true&serverTimezone=UTC";
		String username = "jishu";
		String password = "jishu";
		
		String gndir = "D:/home/mysql";
		String pkg = "com.cpt.wtc";
		FastAutoGenerator.create(url, username, password)
	    .globalConfig(builder -> {
	        builder.author("yanyh") // 设置作者
	            .enableSwagger() // 开启 swagger 模式
	            .fileOverride() // 覆盖已生成文件
	            .outputDir(gndir); // 指定输出目录
	    })
	    .packageConfig(builder -> {
	        builder.parent(pkg) // 设置父包名
	            //.moduleName("cpt") // 设置父包模块名
	     		.controller("controller.biz")
	            .pathInfo(Collections.singletonMap(OutputFile.mapperXml, gndir)); // 设置mapperXml生成路径
	    })
	    .strategyConfig(builder -> {
	        //builder.addInclude("t_apply_join"); // 设置需要生成的表名
	    	builder.controllerBuilder().enableHyphenStyle();  	// 开启驼峰转连字符
	    	builder.entityBuilder().enableLombok();				// 使用lombok
	    	builder.controllerBuilder().enableHyphenStyle()  	// 增加 controller 注解
         .enableRestStyle();		//开启RestController
	    	builder.addInclude( list ).addTablePrefix("t_", "c_"); // 设置过滤表前缀
	    })
	    .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板，默认的是Velocity引擎模板
	    .execute();
	}
	
 
	
	
}
*/



